{% set vrf_command = 'ip vrf exec ' ~ vrf ~ ' ' if vrf is vyos_defined else '' %}
[Unit]
Description=VyOS HTTP API service
After=vyos-router.service
Requires=vyos-router.service
ConditionPathExists={{ api_config_state }}

[Service]
ExecStart={{ vrf_command }}/usr/libexec/vyos/services/vyos-http-api-server
ExecReload=kill -HUP $MAINPID
Type=idle

SyslogIdentifier=vyos-http-api
SyslogFacility=daemon

Restart=on-failure

# Does't work but leave it here
User=root
Group=vyattacfg

[Install]
WantedBy=vyos.target
